package yunquan.wang.modules.base.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import yunquan.wang.base.domain.IdEntity;

/**
 * 权限.
 */
@Entity
@Table(name = "BASE_AUTHORITY")
public class Authority extends IdEntity {
	@Column(name = "NAME")
	private String name;
	@Column(name = "AUTHINFO")
	private String authinfo;
	@ManyToOne
	@JoinColumn(name = "PK_AUTHORITYTYPE")
	private AuthorityType authorityType;
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "authority")
    private Set<RolesAuthority> rolesAuthority=new HashSet<RolesAuthority>(0);
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getAuthinfo() {
		return authinfo;
	}
	public void setAuthinfo(String authinfo) {
		this.authinfo = authinfo;
	}
	public AuthorityType getAuthorityType() {
		return authorityType;
	}
	public void setAuthorityType(AuthorityType authorityType) {
		this.authorityType = authorityType;
	}
	public Set<RolesAuthority> getRolesAuthority() {
		return rolesAuthority;
	}
	public void setRolesAuthority(Set<RolesAuthority> rolesAuthority) {
		this.rolesAuthority = rolesAuthority;
	}
 
	
	
	
}
